package com.kazares.listener;

import javax.servlet.ServletContextAttributeEvent;
import javax.servlet.ServletContextAttributeListener;
import javax.servlet.annotation.WebListener;

/**
 * Web application lifecycle listener.
 * @author Alejandro Cazares
 */
@WebListener()
public class NewServletListener implements ServletContextAttributeListener {

    @Override
    public void attributeAdded(ServletContextAttributeEvent event) {
        System.out.println("Un atributo ha sido agregado: "+event.getName());
    }

    @Override
    public void attributeRemoved(ServletContextAttributeEvent event) {
        System.out.println("Un atributo ha sido removido: "+event.getName());
    }

    @Override
    public void attributeReplaced(ServletContextAttributeEvent event) {
        System.out.println("Un atributo ha sido reemplazado: "+event.getName() + ", "+event.getValue());
    }
}
